package Test;

import domain.Student;
import domain.Student1;

import java.util.ArrayList;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        ArrayList<Student1> list = new ArrayList<>();
        /*Student1 stu = new Student1("张三",18);
        list.add(stu);
        System.out.println(list.get(0).getName()+"...."+list.get(0).getAge());*/
       method(list);
       method(list);
       method(list);
        System.out.println(list.size());
    }
    public static void method(ArrayList<Student1> list){
        Scanner sc  = new Scanner(System.in);
        String name = sc.next();
        int age = sc.nextInt();
        Student1 stu = new Student1(name,age);
        list.add(stu);
    }

}
